package fun.tan90.net.socketd;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;

public class Client {


    public static void main(String[] args) throws IOException {

        SocketChannel socketChannel = SocketChannel.open();

        socketChannel.configureBlocking(false);

        boolean connect = socketChannel.connect(new InetSocketAddress("127.0.0.1", 8602));
        System.out.println(connect);

        ByteBuffer byteBuffer = ByteBuffer.wrap("hello".getBytes());
        byteBuffer.flip();
        socketChannel.write(byteBuffer);
        byteBuffer.clear();

    }
}
